fix(gcs): paginate object prefixes with maxResults - #189
Conversation
|
| Filename | Overview |
|---|---|
| src/main/java/io/floci/gcp/services/gcs/GcsObjectController.java | Combines objects and prefixes into one deterministic result sequence before applying pagination. |
| src/test/java/io/floci/gcp/services/gcs/GcsListFilterRestIntegrationTest.java | Covers combined object-prefix pages, shared result slots, and stable version-generation continuation pages. |
| compatibility-tests/sdk-test-java/src/test/java/io/floci/gcp/test/GcsListFiltersTest.java | Verifies through the Java GCS SDK that directory prefixes honor page size and expose a continuation token. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[List matching objects] --> B{Delimiter supplied?}
B -- No --> C[Convert each object to a listed result]
B -- Yes --> D[Group objects by name]
D --> E[Sort same-name generations numerically]
E --> F[Merge ordered object names and prefixes]
F --> G[Pair a same-name prefix with first object generation]
G --> H[Emit remaining generations separately]
C --> I[Paginate combined listed results]
H --> I
I --> J[Split current page into items and prefixes]
J --> K[Return one shared nextPageToken]
Reviews (3): Last reviewed commit: "fix(gcs): paginate object prefixes with ..." | Re-trigger Greptile
52099c9 to
27131d5
Compare
27131d5 to
17e0911
Compare
|
Thank you, and the curl showing It is confirmed by the spec as well as the probe: The two things the doc does not cover, the shared slot for a same-named prefix and object, and each generation taking its own slot, are the ones your capture settles, and both are pinned by the new tests. No blockers from my side. #188 touches the same lines, so whichever lands second will want a small rebase. |
hectorvent
left a comment
There was a problem hiding this comment.
Contract claims confirmed verbatim against the storage v1 reference. Approving the code; needs a rebase now that #188 has landed.
Summary
Applies
maxResultsto the combined object and prefix listing, with one page token covering both result types.Type of change
fix:)feat:)feat!:orfix!:)GCP Compatibility
The behavior was reproduced in real GCS with objects under
a/andb/:Floci previously returned every prefix and no page token because only
items[]participated in pagination. Real GCS was also checked withincludeTrailingDelimiter=true: a same-named prefix and object are both returned whenmaxResults=1, and together consume one result slot. With versioning enabled, each generation remains a separate, generation-ordered result slot while the same-named prefix is returned once, keeping continuation pages stable.Checklist
./mvnw testpasses locally